package builder;

import org.junit.Test;

/**
 * 建造者模式 测试类
 * @author lihaoshan
 * @date 2018-06-28
 * */
public class BuilderPatternDemo {

    @Test
    public void test(){
        MealBuilder mealBuilder = new MealBuilder();

        Meal vegMeal = mealBuilder.prepareVegMeal();
        System.out.println("***************素食餐***************");
        vegMeal.showItems();
        System.out.println("总合计: " +vegMeal.getCost());

        Meal nonVegMeal = mealBuilder.prepareNonVegMeal();
        System.out.println("\n\n***************非素食餐***************");
        nonVegMeal.showItems();
        System.out.println("总合计: " +nonVegMeal.getCost());
    }
}
